# 定义一个数字（1~10)随机产生，通过3次判断来猜出来数字
import random
num = random.randint(1,10)  # 构建一个范围1到10的变量num
guess_num = int(input('please input the number you guess'))
# 通过if语句来进行猜测
if guess_num == num:
    print('nb')
else:
    if guess_num < num:
        print('the number you guess < the correct number')
    else:
        print('tne number you guess > the correct number')
    guess_num = int(input('you have another chance'))
    if guess_num == num:
        print('nb')
    else:
        if guess_num < num:
            print('the number you guess < the correct number')
        else:
            print('tne number you guess > the correct number')
        guess_num = int(input('you have the last chance'))
        if guess_num == num:
            print('nb')
        else:
            print(f'you have no chance. the correct number is {num}')



